package hibernate;

import java.util.List;

import org.hibernate.Session;

public class SqlQuery {

	public Object queryObject(String sql) {
		Session session = HibernateSessionFactory.getSession();
		Object obj = session.createSQLQuery(sql).uniqueResult();
		
		return obj ;
	}
	@SuppressWarnings("unchecked")
	public List<Object> queryList(String sql){
		Session session = HibernateSessionFactory.getSession();
		
		return (List<Object> )session.createSQLQuery(sql).list() ;
	}
}
